class PlayCell extends zysx.BaseComponent{
	
    private item_box: eui.Rect;

	private line_00: eui.Image;

	private line_01: eui.Image;

	private line_02: eui.Image;

	private line_03: eui.Image;

	public data: QuestionData;

	public target: number;

	public outTarget: number;

	public tsIn: number;

	public tsOut: number;

	public index: number;

	public constructor(data: QuestionData) {
		super(data);
		this.skinName = "PlayCellSkin";

		this.data = data;
		this.x = data.x * CommonData.itemPx;
		this.y = data.y * CommonData.itemPx;

		this.item_box.height = this.item_box.width = CommonData.itemPx - 4;
		
		this.alpha = 1;
		this.index = 0;
		this.target = -1;
		this.outTarget = -1;
		this.tsIn = -1;
		this.tsOut = -1;

		this.updatePage();
	}

	public updatePage(){
		if(this.data.f == 1){
			this.item_box.fillColor = 0x6adcbb;
		}else if(this.data.f == 2){
			this.item_box.fillColor = 0xf18b87;
		}else if(this.target > -1){
			this.item_box.fillColor = 0x6adcbb;
		}else{
			this.item_box.fillColor = 0xdedddd;
		}
		//初始化方框
		this.line_00.visible = this.line_01.visible = this.line_02.visible = this.line_03.visible = false;
		this.item_box.height = this.item_box.width = CommonData.itemPx - 4;

		if(this.target > -1){
			switch(this.target){
				case 0: this.item_box.height = CommonData.itemPx; this.line_00.visible = true; break;
				case 1: this.line_01.visible = true; break;
				case 2: this.line_02.visible = true; break;
				case 3: this.item_box.width = CommonData.itemPx; this.line_03.visible = true; break;
			}
		}
		
		if(this.outTarget > -1){
			switch(this.outTarget){
				case 0: this.item_box.height = CommonData.itemPx; this.line_00.visible = true; break;
				case 1: this.line_01.visible = true; break;
				case 2: this.line_02.visible = true; break;
				case 3: this.item_box.width = CommonData.itemPx; this.line_03.visible = true; break;
			}
		}

		if(this.tsIn > -1){
			switch(this.tsIn){
				case 0: this.line_00.visible = true; break;
				case 1: this.line_01.visible = true; break;
				case 2: this.line_02.visible = true; break;
				case 3: this.line_03.visible = true; break;
			}
		}

		if(this.tsOut > -1){
			switch(this.tsOut){
				case 0: this.line_00.visible = true; break;
				case 1: this.line_01.visible = true; break;
				case 2: this.line_02.visible = true; break;
				case 3: this.line_03.visible = true; break;
			}
		}
	}

    
	public onOpen(data?):void{
		super.onOpen(data)
	}
}